package hotgammon.view.tools;

import hotgammon.view.BackgammonUserInterface;
import hotgammon.view.figures.DieFigure;

import java.awt.event.MouseEvent;

import minidraw.framework.Figure;
import minidraw.standard.NullTool;

public class GameWonTool extends NullTool {

private BackgammonUserInterface objectServer;
	
	public GameWonTool(BackgammonUserInterface ui) {
	    this.objectServer = ui;
	}
	
	public void mouseDown(MouseEvent e, int x, int y) {
	    Figure f = objectServer.getEditor().drawing().
	      findFigure(e.getX(), e.getY());
	    if (f instanceof DieFigure)
	    	objectServer.getGame().newGame();
	}
}
